package com.huidan.cms.core;

import com.huidan.cms.core.handler.RenderHandlerMethodReturnValueHandler;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.method.support.HandlerMethodReturnValueHandler;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import java.util.List;

/**
 * 启动配置
 * Created by Administrator on 2017/10/24.
 */
@Data
public class XMaxConfig extends WebMvcConfigurerAdapter {

    /**
     * 返回值对象处理
     */
    @Autowired
    private RenderHandlerMethodReturnValueHandler renderHandlerMethodReturnValueHandler;

    @Override
    public void addReturnValueHandlers(List<HandlerMethodReturnValueHandler> returnValueHandlers) {
        returnValueHandlers.add(renderHandlerMethodReturnValueHandler);
        super.addReturnValueHandlers(returnValueHandlers);
    }
}
